#include "myobject.h"
#include"worker.h"
#include<QThread>

MyObject::MyObject(QObject *parent) : QObject(parent)
{

}
void MyObject::putWorkerInThread(){
    Worker *worker = new Worker;
    QThread *workerThread = new QThread(this);
    connect(workerThread,&QThread::started,worker,&Worker::doWork);
    connect(workerThread,&QThread::finished,worker,&Worker::deleteLater);

    worker->moveToThread(workerThread);

    workerThread->start();

}
